package com.zhx.rmq.consumer.controller;

import com.zhx.rmq.utils.HttpClientUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

@Slf4j
@Component
@RabbitListener(queues = "directQueue")//监听的队列名称 directQueue
public class DirectReceiver3 {

    /**
     * 多个消费者监听同一个直连交互的同一个队列
     * 就会变成轮询消费模式
     * 且不会重复消费
     * @param msg
     */

    @RabbitHandler
    public void process(Map msg) {
        log.info("消费者3收到消息ID: [{}]",msg.toString());
    }

}